package screen.item;

import globals.Global;

public abstract class InteractableItem implements ScreenItem {

	protected int x, y, width, height;
	protected boolean mouseOver;
	
	public void Update(float elapsed) {
		// Check for MouseOver
		if (Global.Instance().input.mouseX > x &&
			Global.Instance().input.mouseX < x+width &&
			Global.Instance().input.mouseY > y &&
			Global.Instance().input.mouseY < y+height) {
			mouseOver = true;
		} else {
			mouseOver = false;
		}
		
		// Check for mouse click
		if (Global.Instance().input.isMouseClickedCheck()) mouseClick();
	}
	
	public abstract void mouseClick();
}
